﻿@using MealBooking.Core.Models.Dishes;
<li data-role="list-divider">Select Dishes : </li>
<li>
    <div data-role="controlgroup">
        @{
            List<Dish> selectedDishes = ViewBag.SelectedDishes;
            if (selectedDishes != null && selectedDishes.Count != 0)
            {
                foreach (var dish in selectedDishes)
                {
            <input type="checkbox" name="DishIds" id="@dish.Id" value="@dish.Id" checked="checked" data-mini="true" />
            <label title="@dish.Description" for="@dish.Id">@dish.Name
            </label>
                }
            }
            List<Dish> dishesWithoutDishCategory = ViewBag.DishesWithoutDishCategory;
            if (dishesWithoutDishCategory != null && dishesWithoutDishCategory.Count != 0)
            {
                foreach (var dish in dishesWithoutDishCategory)
                {
            <input type="checkbox" name="DishIds" id="@dish.Id" value="@dish.Id" data-mini="true" />
            <label title="@dish.Description" for="@dish.Id">@dish.Name</label>
                }
            }
            List<Dish> dishes = ViewBag.Dishes;
            if (dishes != null && dishes.Count != 0)
            {
                foreach (var dish in dishes)
                {
            <input type="checkbox" name="DishIds" id="@dish.Id" value="@dish.Id" data-mini="true" data-theme="e"/>
            <label title="@dish.Description" for="@dish.Id">@dish.Name [Category : @dish.Category.Name]</label>
                }
            }
        }
    </div>
</li>
